<template>
  <div class="body vertical center ">
    <div class="sm_top">
      <div :class="`item_list ${curWay._payname === item._payname ? 'active' : ''}`"
        v-for="(item, index) in legalRecharge" :key="index" @click="chooseWay(item)">
        {{ t(`api_${item._payname}`) }}
      </div>
    </div>
    <div class="sm_content">
      <ImgT :src="`/imgs/payment/sm/sm_${curWay._payname}.webp`" />
    </div>

  </div>
</template>

<script setup lang='ts'>
import { useI18n } from "vue-i18n";
import { ref } from 'vue';
import { Local } from "@/utils/storage";

const { t } = useI18n();
const curWay = ref(Local.get('curExplainWay') || { _payname: '' });
const legalRecharge = ref<any>(Local.get('depositWayObj')?.legalRecharge || []);

// 选择充值方式
const chooseWay = (data: any) => {
  Local.set('curExplainWay', data);
  curWay.value = data;
}
</script>

<style lang='scss' scoped>
.body {
  height: calc(100vh - 55px - 65px);
  overflow: hidden;
  color: #93b4ff;
  font-size: 14px;

  .sm_top {
    padding: 14px 11.5px 12px;
    display: flex;
    overflow-x: auto;

    .item_list {
      position: relative;
      flex: auto;
      display: flex;
      justify-content: center;
      align-items: center;
      min-width: 80px;
      height: 44px;
      padding: 10px;
      color: #C6C4F5;
      &.active {
        color: #5B6CFF;
        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          width: 100%;
          height: 2px;
          background: linear-gradient(180deg, #5B6CFF 0%, #9E1EFF 100%);
        }
      }

    }
  }

  .sm_content {
    padding: 0 11.5px 14px;
    height: calc(100% - 60px);
    overflow-y: auto;

    img {
      width: 100%;
    }
  }
}
</style>